home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 49
/
Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso
/
-serious-
/
graphics
/
amicad
/
arexx_english
/
mapkey.amicad
< prev
next >
Wrap
Text File
|
1999-12-06
|
1KB
|
42 lines
/* MapKey
Programmation d'une séquence de touches
Version 1.00e (25 septembre 1999)
$VER: MapKey.AmiCAD 1.00e (® R.Florac, 25 septembre 1999) */
options results /* indispensable pour récupérer le résultat des macros */
signal on error /* pour l'interception des erreurs */
signal on syntax
keys=getclip(key_sequence)
if key~="" then keys=doublage_guillemets(keys)
'INIT(KEY_SEQ,KEY_MACRO):KEY_SEQ=ASKTEXT("Key sequence"+CHR(10)+"to program ?","'keys'")'
key=result
if key~="" then do
setclip(key_sequence,key)
'KEY_MACRO=ASKTEXT("Macro to associate to "+KEY_SEQ,READMAP(KEY_SEQ))'
if result~="" then 'MAP(KEY_SEQ,KEY_MACRO)'
end
exit
doublage_guillemets: procedure
parse arg chaine
t=''
do i=1 to length(chaine)
c = substr(chaine,i,1)
if c='"' then c=c||'"'
t=t||c
end
return t
/* Traitement des erreurs, interruption du programme */
syntax:
erreur=RC
'MESSAGE("Script MapKey.AmiCAD"+CHR(10)+"Syntax error"+CHR(10)+"in line 'SIGL'"+CHR(10)+"'errortext(erreur)'")'
exit
error:
'MESSAGE("Script MapKey.AmiCAD"+CHR(10)+"Error in line 'SIGL'")'
exit